/*
 * Public Credit Information Sharing Platform(PCISP).
 * Copyright (c) 2019-2020 jsxzkingdee and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 * Please visit https://www.zhengxinsoft.com if you need additional information or have any questions.
 */

package com.platform.core.service;


import com.platform.comm.service.CommonBiz;
import com.platform.comm.enums.YnEnum;
import com.platform.comm.exceptions.RestApiException;
import com.platform.enums.CommFlagType;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;

/**
 * @author libinal
 */
public interface BaseEntityBiz<T extends Serializable> extends CommonBiz<T, String> {

    String ROUTE_SEPARATOR = ";";
    String UNIFIEDCODE_DEFAULT_VALUE = "00000000000000000X";

    /**
     * 删除
     *
     * @param id ID
     */
    default void remove(String id) {
        throw new RestApiException("未实现具体业务");
    }

    /**
     * 批量删除
     *
     * @param ids ID列表
     */
    default void batchRemove(List<String> ids) {
        throw new RestApiException("未实现具体业务");
    }

    /**
     * 修改状态
     *
     * @param ids          ID列表
     * @param commFlagType 状态
     */
    default void changeStatus(List<String> ids, CommFlagType commFlagType) {
        throw new RestApiException("未实现具体业务");
    }

    /**
     * 修改状态
     *
     * @param id           唯一标识
     * @param commFlagType 状态
     */
    default void changeStatus(String id, CommFlagType commFlagType) {
        changeStatus(Collections.singletonList(id), commFlagType);
    }

    /**
     * 修改删除状态
     *
     * @param ids    唯一标识
     * @param ynEnum 状态
     */
    default void changeDelFlag(List<String> ids, YnEnum ynEnum) {
        throw new RestApiException("未实现具体业务");
    }

    /**
     * 逻辑删除
     *
     * @param id     唯一标识
     * @param ynEnum 状态
     */
    default void changeDelFlag(String id, YnEnum ynEnum) {
        changeDelFlag(Collections.singletonList(id), ynEnum);
    }
}
